const merge = require('webpack-merge')
const webpack = require('webpack')
module.exports = function(){
	const { platform, debug, mock } = this.command
	return merge({}, this.baseWebpackConf, this.userEnvConf.webpackConfig, {
		plugins: [
			new webpack.DefinePlugin(this.userEnvConf.envConfig),
			new webpack.DefinePlugin({
				'process.env.PLATFORM': JSON.stringify(platform),
				'process.env.DEBUG': JSON.stringify(!!debug),
				'process.env.MOCK': JSON.stringify(!!mock)
			})
		]
	})
}